import { fileURLToPath, URL } from 'node:url'
import { FileSystemIconLoader } from '@iconify/utils/lib/loader/node-loaders'
import {
  defineConfig,
  presetAttributify,
  presetIcons,
  presetTypography,
  presetUno,
  presetWebFonts,
  transformerDirectives,
  transformerVariantGroup,
} from 'unocss'

export default defineConfig({
  shortcuts: {
    'wh-full': 'h-full w-full',
  },
  rules: [
    ['v-hidden', { visibility: 'hidden' }],
  ],
  presets: [
    presetUno(),
    presetAttributify(),
    presetIcons({
      warn: true,
      collections: {
        local: FileSystemIconLoader(fileURLToPath(new URL('./src/assets/icons', import.meta.url))),
      },
    }),
    presetWebFonts(),
    presetTypography(),
  ],
  transformers: [
    transformerDirectives(),
    transformerVariantGroup(),
  ],
})
